﻿<EpiDashboard:GadgetBase
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EpiDashboard="clr-namespace:EpiDashboard"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"
    x:Class="EpiDashboard.Gadgets.Analysis.DuplicatesListControl"    
    Style="{DynamicResource gadgetBaseStyle}">
    <EpiDashboard:GadgetBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\..\ResourceDictionary.xaml"/>
                <ResourceDictionary Source="..\..\StyleDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </EpiDashboard:GadgetBase.Resources>
    
    <Grid>
        <Controls:ShadowRectangle x:Name="rectangleShadow"></Controls:ShadowRectangle>

        <Border Name="borderAll" Style="{DynamicResource GadgetBorderStyle}" >
            <Border.ContextMenu>
                <ContextMenu x:Name="gadgetContextMenu">
                    <MenuItem x:Name="mnuCopy" Header="Copy list data to clipboard"/>
                    <MenuItem x:Name="mnuSendDataToHTML" Header="Send list data to web browser">
                        <MenuItem.Icon>
                            <Image Source="../../Images/saveHTML.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuSendDataToExcel" Header="Send list data to Excel" />
                    <Separator/>
                    <MenuItem x:Name="mnuRemoveSorts" Header="Remove all sort criteria"/>
                    <Separator/>
                    <MenuItem x:Name="mnuSendToBack" Header="Send list to back"/>
                    <!--<MenuItem x:Name="mnuRefresh" Header="Refresh line list">
                        <MenuItem.Icon>
                            <Image Source="../../Images/refresh1.png" />
                        </MenuItem.Icon>
                    </MenuItem>-->
                    <MenuItem x:Name="mnuCenter" Header="Center horizontally"/>
                    <MenuItem x:Name="mnuClose" Header="Close line list"/>
                </ContextMenu>
            </Border.ContextMenu>
            <Grid x:Name="grdMain">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <Controls:GadgetHeaderPanel x:Name="headerPanel" Grid.Row="0" IsDescriptionButtonAvailable="False" IsFilterButtonAvailable="False"  Text="Duplicates List" />
                <Controls:GadgetMessagePanel Margin="4" x:Name="messagePanel" Grid.Row="2" Text="" />
                <Controls:GadgetDescriptionPanel Grid.Row="4" PanelMode="Collapsed" x:Name="descriptionPanel"></Controls:GadgetDescriptionPanel>

                <!--<TextBlock Grid.Row="6" x:Name="txtFilterString" Style="{DynamicResource filterStringText}" Visibility="Collapsed" >
                </TextBlock>-->

                <Controls:GadgetInfoPanel Grid.Row="4" Visibility="Collapsed" Margin="4" x:Name="infoPanel"></Controls:GadgetInfoPanel>

                <StackPanel Grid.Row="7" x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top"></StackPanel>

                <Controls:GadgetWaitPanel x:Name="waitPanel" Visibility="Collapsed" Grid.Row="1" Grid.RowSpan="6" Style="{DynamicResource gadgetWaitPanelStyle}" />
                <StackPanel Grid.Row="1" Grid.RowSpan="7" Orientation="Vertical" Margin="00,-15,-10,0" HorizontalAlignment="Right" VerticalAlignment="Top" >                    
            <!--<Grid x:Name="ConfigGrid" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,10,0" >
                        <Rectangle Style="{DynamicResource rectangleConfigOuter}" />
                        <Rectangle Style="{DynamicResource rectangleConfigInner}" />
                
                        <Path x:Name="pathTriangle" 
                              Margin="0,-2,90,0"
                              Data="M 5 0 L 10 10 0 10 Z" Fill="{DynamicResource gadgetBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Right" VerticalAlignment="Top" Height="7" />                
                        
                <StackPanel Orientation="Vertical" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Top" >                    
                    <TextBlock x:Name="tblockLineListProperties" HorizontalAlignment="Center" TextAlignment="Center" Text="Line List Properties" Margin="5" FontWeight="Bold" />

                            <Grid x:Name="grdLineListOptions" Width="Auto">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="84"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="12"/>
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="190"/>
                                    <ColumnDefinition Width="170"/>
                                    <ColumnDefinition Width="170"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock x:Name="tblockListVariablesToDisplay" Grid.Row="0" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,0" Text="List variables to display:" TextAlignment="Center" />
                                <ListBox FontFamily="Global User Interface" Grid.Row="1" Grid.RowSpan="10" HorizontalAlignment="Left" Margin="0,0,0,0" Name="lbxFields" SelectedIndex="0" SelectionMode="Extended" Width="180" />

                                <TextBlock x:Name="tblockSortVariables" Grid.Row="0" Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Sort variables:" TextAlignment="Center" />
                                <ComboBox HorizontalAlignment="Left" MaxWidth="160" Name="cbxSortField" SelectedIndex="0" Width="160" Grid.Column="1" Grid.Row="1" />

                                <TextBlock x:Name="tblockSortOrder" Grid.Row="2" Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Sort order: *" TextAlignment="Center" />
                                <ListBox FontFamily="Global User Interface" Grid.Row="3" Grid.Column="1" Grid.RowSpan="8" HorizontalAlignment="Left" Margin="0,0,0,0" Name="lbxSortFields" SelectedIndex="0" SelectionMode="Single"  Width="160">
                                    <ListBox.ContextMenu>
                                    <ContextMenu>
                                            <MenuItem x:Name="mnuSwapSortType" Header="Change ascending/descending"></MenuItem>
                                            <MenuItem x:Name="mnuRemove" Header="Remove field"></MenuItem>
                                    </ContextMenu>
                                    </ListBox.ContextMenu>
                                </ListBox>

                                <TextBlock x:Name="tblockGroupResultsBy" Grid.Row="0" Grid.Column="2" VerticalAlignment="Bottom" Grid.RowSpan="1" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Group results by:" TextAlignment="Center" />
                                <ComboBox HorizontalAlignment="Left" MaxWidth="160" Name="cbxGroupField" SelectedIndex="0" Width="160" Grid.Column="2" Grid.Row="1" />

                                <TextBlock x:Name="tblockMaxVarNameLength" Grid.Column="2" Grid.Row="2" VerticalAlignment="Bottom"  HorizontalAlignment="Left" TextAlignment="Center" Text="Max variable name length:" Margin="0,5,0,0"  />
                                <TextBox x:Name="txtMaxColumnLength" Grid.Column="2" Grid.Row="3"  Width="60" HorizontalAlignment="Left" Text="24" Margin="0, 0, 0, 0" PreviewTextInput="txtMaxColumns_PreviewTextInput"></TextBox>

                                <TextBlock x:Name="tblockMaxRows" Grid.Column="2" Grid.Row="4" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max rows to display:" Margin="0,5,0,0"  />
                                <TextBox x:Name="txtMaxRows" Grid.Column="2" Grid.Row="5" Width="60" HorizontalAlignment="Left" Text="50" Margin="0, 0, 0, 00" PreviewTextInput="txtMaxColumns_PreviewTextInput" TextChanged="txtMaxRows_TextChanged"></TextBox>
                                
                                <TextBlock x:Name="tblockInst1" Grid.Column="0" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="Ctrl+Left-click on variable names. Ctrl+A will select all variables." Margin="0,0,0,0"  />
                                <TextBlock x:Name="tblockInst2" Grid.Column="1" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="* Right-click on variables to remove or change sort properties." Margin="0,0,0,0"  />
                                <StackPanel Grid.Row="6" Grid.RowSpan="8" Margin="0,8,0,0" Grid.Column="2">
                                    <Grid x:Name="grdDimensions" Margin="0,0,0,5">
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition Width="10" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                    <TextBlock x:Name="tblockMaxHeight" Grid.Row="0" Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max height:" Margin="0,5,0,0"  />
                                        <TextBox x:Name="txtMaxHeight" Grid.Row="1" Grid.Column="2" Width="60" HorizontalAlignment="Left" Text="500" PreviewKeyDown="txtInput_PositiveIntegerOnly_PreviewKeyDown" Margin="0, 0, 0, 0"></TextBox>

                                    <TextBlock x:Name="tblockMaxWidth" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max width:" Margin="0,5,0,0"  />
                                        <TextBox x:Name="txtMaxWidth" Grid.Row="1" Grid.Column="0" Width="60" HorizontalAlignment="Left" Text="800" PreviewKeyDown="txtInput_PositiveIntegerOnly_PreviewKeyDown" Margin="0, 0, 0, 0"></TextBox>
                                    </Grid>
                                    <CheckBox x:Name="checkboxTabOrder" Margin="0,2,0,0" Content="Sort variables by tab order" Visibility="Visible" IsEnabled="true" />
                                    <CheckBox x:Name="checkboxUsePrompts" Margin="0,2,0,0" Content="Use field prompts" Visibility="Visible" IsEnabled="true" />
                                    <CheckBox x:Name="checkboxListLabels" Margin="0,2,0,0" Content="Display list labels" IsEnabled="true"/>
                                    <CheckBox x:Name="checkboxLineColumn" Margin="0,2,0,0" Content="Show line column" IsChecked="True" />
                                    <CheckBox x:Name="checkboxColumnHeaders" Margin="0,2,0,0" Content="Show column headings" IsChecked="True" />
                                    <CheckBox x:Name="checkboxShowNulls" Margin="0,2,0,0" Content="Show missing representation" IsChecked="True" />
                                    <CheckBox x:Name="checkboxAllowUpdates" Margin="0,2,0,0" Content="Allow updates" Visibility="Collapsed" IsEnabled="true" />
                                </StackPanel>
                            </Grid>
                    
                            <Button x:Name="btnRun" Content="Generate Line List" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Click="btnRun_Click" />
                    
                        </StackPanel>
            </Grid>-->
        </StackPanel>                
            </Grid>
        </Border>
    </Grid>
</EpiDashboard:GadgetBase>
